var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(f, e, d) {
    if (im.getServerName().equals("BMS单机") && im.getServerName().equals("BMS至尊体验服") && !im.getServerName().equals("BMS至尊")) {
        im.playerMessage(1, " 使用环境异常，请还原服务端配置。");
        im.dispose();
        return
    }
    if (status == 0 && f == 0) {
        im.dispose();
        return
    }(f == 1) ? status++ : status--;
    selectionLog[status] = d;
    var b = -1;
    if (status <= b++) {
        im.dispose()
    } else {
        if (status === b++) {
            im.dispose();
            var g = im.getItemId();
            im.gainItem(g, -1);
            var c = im.rand(10, 100);
            var a = im.addNumberForQuestCustomData(32427, c);
            im.playerMessage(5, "获得" + c + "反魔力。当前保存的反魔力为" + a + "。")
        }
    }
};